#include "HydrofobicAntiStainCompartiment.h"
#include "EventHandler.h"
#include "Arduino.h"
HydrofobicAntiStainCompartiment::HydrofobicAntiStainCompartiment(ISoapHAL* HAL)
{
	this->HAL = HAL;
    trayStatus = EMPTY;

}

void HydrofobicAntiStainCompartiment::flush()
{

	//TOO DIFFICULT TO PASS FUNCTION REFERENCE. HARDCODED.
    if(index == 0)
    {
        HAL->tray1FlushSoapIntoASSWD();
    }
    else
    {
        HAL->tray2FlushSoapIntoASSWD();
    }
}

void HydrofobicAntiStainCompartiment::setIndex(int nr)
{
    index = nr;
return;
    if (nr == 0)
    {

        //HAL->onTray1Filled->addHandler(onTrayFilledHandler);
    }
    else
    {
        //HAL->onTray2Filled->addHandler(onTrayFilledHandler);
    }
}

void HydrofobicAntiStainCompartiment::onTrayFilled()
{
    trayStatus = FILLED;
}

void HydrofobicAntiStainCompartiment::onTrayFlushed()
{
    trayStatus = EMPTY;
}

void HydrofobicAntiStainCompartiment::lock()
{
}

void HydrofobicAntiStainCompartiment::unlock()
{
}
